<?php if (!defined('THINK_PATH')) exit();?><form id="pagerForm" action="__URL__" method="post">
	<input type="hidden" name="pageNum" value="1"/>
	<input type="hidden" name="_order" value="<?php echo ($_REQUEST["_order"]); ?>"/>
	<input type="hidden" name="_sort" value="<?php echo ($_REQUEST["_sort"]); ?>"/>
    <input type="hidden" name="numPerPage" value="<?php echo ($_REQUEST["numPerPage"]); ?>" />
</form>


<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return navTabSearch(this);" action="__URL__" method="post">
	<div class="searchBar">
      <table>
			<tr>
				<td style="white-space: nowrap;">单据编号：<input type="text" name="selectname" value="<?php echo ($_POST['selectname']); ?>"/>
				</td>
				<td style="white-space: nowrap;" title="单据类型"><select class="combox" name="ordertype">
    				<option value="">所有单据</option>
    				<option value="1" <?php if(($_POST['ordertype']) == "1"): ?>selected<?php endif; ?>>进货单</option>
    				<option value="2" <?php if(($_POST['ordertype']) == "2"): ?>selected<?php endif; ?>>进货退货单</option>
    				<option value="3" <?php if(($_POST['ordertype']) == "3"): ?>selected<?php endif; ?>>销售单</option>
    				<option value="4" <?php if(($_POST['ordertype']) == "4"): ?>selected<?php endif; ?>>销售退货单</option>
    				<option value="5" <?php if(($_POST['ordertype']) == "5"): ?>selected<?php endif; ?>>仓库组装单</option>
    			</select>
				</td>
				<td style="white-space: nowrap;" title="状态"><select class="combox" name="dealstatus">
                    <option <?php if(($_POST['dealstatus']) == "0"): ?>selected<?php endif; ?> value="0">所有状态</option>
					<option <?php if(($_POST['dealstatus']) == "1"): ?>selected<?php endif; ?> value="1">未结库</option>
                    <option <?php if(($_POST['dealstatus']) == "2"): ?>selected<?php endif; ?> value="2">未结款</option>
					<option <?php if(($_POST['dealstatus']) == "3"): ?>selected<?php endif; ?> value="3">已结单</option>
				</select>
				</td>
			</tr>
		</table>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索单据</button></div></div></li>
			<!--	<li><a class="button" href="demo_page6.html" target="dialog" mask="true" title="查询框"><span>高级检索</span></a></li>-->
			</ul>
		</div>
	</div>
	</form>
</div>

<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="edit" href="__URL__/doDealOder" target="selectedTodo" mask="true" rel="ids[]" title="注意:处理单据后无法撤销,你确定要提交数据库吗？" warn="请选择要处理的单据"><span>处理选中单据</span></a></li>
			<li><a class="delete" href="__URL__/delOrders" target="selectedTodo" rel="ids[]" title="警告:删除后无法恢复,你确定要删除吗？" warn="请选择要删除的单据"><span>删除选中单据</span></a></li>
            <!--<li><a class="icon" href="dwz-team.xls" target="dwzExport" targetType="navTab" title="实要导出这些记录吗?"><span>导出EXCEL</span></a></li>-->
			</ul>
	</div>
    <div layoutH="119">
	<table class="list" width="98%" targetType="navTab" asc="asc" desc="desc">
		<thead>
		<tr>
            <th><input type="checkbox" group="ids[]" class="checkboxCtrl"></th>
			<th align=center orderField="ordernumber" <?php if($_REQUEST["_order"] == 'ordernumber'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>单据编号</th>
			<th align=center orderField="ordertype" <?php if($_REQUEST["_order"] == 'ordertype'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>单据类型</th>
			<th align=center orderField="sendname" <?php if($_REQUEST["_order"] == 'sendname'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>单据对象</th>
			<th align=center orderField="warehouse" <?php if($_REQUEST["_order"] == 'warehouse'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>仓 库</th>
            <th align=center orderField="ordertime" <?php if($_REQUEST["_order"] == 'ordertime'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>单据日期</th>
            <th align=center orderField="ordernums" <?php if($_REQUEST["_order"] == 'ordernums'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>交易数量</th>
            <th align=center orderField="orderamount" <?php if($_REQUEST["_order"] == 'orderamount'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>交易金额(￥)</th>
            <th align=center orderField="orderuser" <?php if($_REQUEST["_order"] == 'orderuser'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>经办人</th>
            <th align=center orderField="createuser" <?php if($_REQUEST["_order"] == 'createuser'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>制单人</th>
            <th align=center orderField="createtime" <?php if($_REQUEST["_order"] == 'createtime'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>建单日期</th> 
            <th align=center orderField="dealstatus" <?php if($_REQUEST["_order"] == 'dealstatus'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>结库状态</th> 
            <th align=center orderField="stkstatus" <?php if($_REQUEST["_order"] == 'stkstatus'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>结款状态</th> 
            <th align=center orderField="paystatus" <?php if($_REQUEST["_order"] == 'paystatus'): ?>class="<?php echo ($_REQUEST["_sort"]); ?>"<?php endif; ?>>单据状态</th> 
            <th align=center>操作</th>      	
		</tr>
		</thead>
		<tbody>
		<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr target="sid_user" rel="<?php echo ($vo['id']); ?>">
                <td><input name="ids[]" value="<?php echo ($vo['id']); ?>" type="checkbox"></td>
				<td align=center><a href="__URL__/printOrder/orderId/<?php echo ($vo['id']); ?>" class="printOrder" title="<?php echo ($vo['ordernumber']); ?>" target="navTab" mask="true"><?php echo ($vo['ordernumber']); ?></a></td>
				<td align=center><?php echo (getordertype($vo['ordertype'])); ?></td>
				<td><?php echo (gettablecolval($vo['contactid'],Contacts,comname)); ?></td>
                <td><?php echo (gettablecolval($vo['warehouse'],Warehouse,wahname)); ?></td>                
                <td align=center><?php echo (date("Y-m-d",$vo['ordertime'])); ?></td>                
                <td align=center><?php echo ($vo['ordernums']); ?></td>
                <td align=right><?php echo ($vo['orderamount']); ?></td>
                <td align=center><?php echo (gettablecolval($vo['orderuser'],User,nickname)); ?></td>
                <td align=center><?php echo (gettablecolval($vo['createuser'],User,nickname)); ?></td>
                <td align=center><?php echo (date("Y-m-d  H:i:s",$vo['createtime'])); ?></td>
                <td align=center><?php echo (getstkstatus($vo['stkstatus'])); ?></td>
                <td align=center><?php echo (getpaystatus($vo['paystatus'])); ?></td>
				<td align=center><?php echo (getdealstatus($vo['status'])); ?></td>
                <td align=center><?php echo (showdealstatus($vo['status'],$vo['id'])); ?></td>
                                      
			</tr><?php endforeach; endif; else: echo "" ;endif; ?>
		</tbody>
	</table>
    </div>
	<div class="panelBar">
		<div class="pages">
            <span>显示</span>
			<select name="numPerPage" class="combox" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="1">20</option>
				<option value="50">50</option>
				<option value="100">100</option>
				<option value="200">200</option>
			</select>
			<span>共<?php echo ($totalCount); ?>条</span>
		</div>
		<div class="pagination" targetType="navTab" totalCount="<?php echo ($totalCount); ?>" numPerPage="<?php echo ($numPerPage); ?>" pageNumShown="10" currentPage="<?php echo ($currentPage); ?>"></div>
	</div>
</div>